package com.tomorrow.weather.ui;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.tomorrow.simplefactory.http.HttpFactory;
import com.tomorrow.weather.mInterface.HttpApi;

public class NetTestActivity extends Activity
{
	private TextView tvNetTest;
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_net_test);
		tvNetTest = (TextView) findViewById(R.id.net_test);
		tvNetTest.setOnClickListener(new OnClickListener()
		{
			
			@Override
			public void onClick(View v)
			{
				
				HttpApi httpApi = HttpFactory.getHttp();
				String content = httpApi.getUrlContent("http://www.weather.com.cn/weather/101010100.shtml");
				tvNetTest.setText(content);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu)
	{
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_net_test, menu);
		return true;
	}

}
